﻿* Encoding: UTF-8.
*** ENGAGEMENT ***

weight by xcweight.
freq xc72.
compute xc72r=xc72.
recode xc72r (1=4)(2=3)(3=2)(4=1)(-98=1).
value labels xc72r 1 'Not much' 2 'Occasionally' 3 'Moderately closely' 4 'Very closely'.

compute xc75ar=xc75a.
compute xc75br=xc75b.
compute xc75cr=xc75c.
compute xc75dr=xc75d.
compute xc75er=xc75e.
compute xc75fr=xc75f.
recode xc75ar xc75br xc75cr xc75dr xc75er xc75fr (-98=0).

weight by xcweight.
compute xc75bcr=0.
if ((xc75br eq 1) or (xc75cr eq 1)) xc75bcr=1.
freq xc75bcr.

missing values  xc72r xc75ar xc75bcr xc75dr xc75er xc75fr (-99).
descriptives var=xc72r xc75ar xc75bcr xc75dr xc75er xc75fr /save.

compute engage16fa = (zxc72r*.58)+(zxc75ar*.51)+(zxc75dr*.48)+(zxc75fr*.57).
freq engage16fa/stat=mean std.

compute engage16ix=rnd(10*(engage16fa+2.27)/6.60).
freq engage16ix/stat=mean std semean. 

weight by xcweight.
recode engage16ix (sysmis=-99).
missing values engage16ix (-99).
freq engage16ix/stat=mean std semean.

freq engage16ix.

weight by xcweight.
missing values engage16ix ().
compute engage16r5=engage16ix.
recode engage16r5 (0,1=1)(2,3=2)(4,5,6=3)(7,8=4)(9,10=5).
value labels engage16r5 1 '0-1' 2 '2-3' 3 '4-6' 4 '7-8' 5 '9-10'.
missing values engage16r5 (-99).
freq engage16r5.



*** INTEREST 

compute xc70mr=xc70m.
recode xc70mr (1=3)(2=2)(3=1)(-98=1).
value labels xc70mr 1 'Not at all' 2 'Modrately' 3 'Very'.

compute xc72r=xc72.
recode xc72r (1=4)(2=3)(3=2)(4=1)(-98=1).
value labels xc72r 1 'Not at all' 2 'Occasionally' 3 'Moderately' 4 'Very closely'.

missing values xc70mr (-99).
crosstabs tab=xc70mr by xc72r/cells=count tot/stat=gamma.

compute xc73r=xc73.
recode xc73r (1=1)(else=0).
value labels xc73r 1 'Registered'.
freq xc73r.

missing values xc76ar xc76br xc76cr xc76ir xc76lr xc76mr (-99).

compute xc76ar=xc76a.
recode xc76ar (-98=0)(1 thru 10=1)(11 thru 20=2)(21 thru 50=3)(51 thru hi=4).
value labels xc76ar 0 'None' 1 '1-10' 2 '11-20' 3 '21-50' 4 '50 or more'.

compute xc76br=xc76b.
recode xc76br (-98=0)(1 thru 10=1)(11 thru 30=2)(31 thru hi=3).
value labels xc76br 0 'None' 1 '1-10' 2 '11-30' 3 '31 or more'.

compute xc76cr=xc76c.
recode xc76cr (-98=0)(1 thru 10=1)(11 thru 40=2)(41 thru 100=3)(101 thru hi=4).
value labels xc76cr 0 'None' 1 '1-10' 2 '11-40' 3 '41-100' 4 '101+'.

compute xc76ir=xc76i.
recode xc76ir (-98=0)(1 thru 10=1)(11 thru 20=2)(21 thru 50=3)(51 thru hi=4).
value labels xc76ir 0 'None' 1 '1-10' 2 '11-20' 3 '21-50' 4 '51+'.

compute xc76lr=xc76l.
recode xc76lr (-98=0)(1 thru 10=1)(11 thru 30=2)(31 thru 90=3)(91 thru hi=4).
value labels xc76lr 0 'None' 1 '1-10' 2 '11-30' 3 '31-90' 4 '91+'.

compute xc76mr=xc76m.
recode xc76mr (-98=0)(1 thru 10=1)(11 thru hi=2).
value labels xc76mr 0 'None' 1 '1-0' 2'11+'.

freq xc70mr xc72r xc73r xc76ar xc76br xc76cr xc76ir xc76lr xc76mr.

weight by xcweight.
missing values xc70mr xc72r xc76ar xc76br xc76cr xc76ir xc76lr (-99).
descriptives var=xc70mr xc72r xc76ar xc76br xc76cr xc76ir xc76lr/save.

compute polint16fa=(zxc70mr*.64)+(zxc72r*.66)+(zxc76ar*.57)+(zxc76br*.59)+(zxc76cr*.85)+(zxc76ir*.75)+(zxc76lr*.58).
freq polint16fa/stat=mean std.

compute polint16ix=rnd(10*(polint16fa+7.06)/14.63).
freq polint16ix/stat=mean std semean. 

compute polint16r5=polint16ix.
recode polint16r5 (0,1=1)(2,3=2)(4,5,6=3)(7,8=4)(9,10=5).
value labels polint16r5 1 '0-1' 2 '2-3' 3 '4-6' 4 '7-8' 5 '9-10'.
freq polint16r5.

weight by xaweight.

count gremploy=xa43a xa43b xa43d xa43e (1).
recode gremploy (4=3).
value labels gremploy 0 'None' 1 'One' 2 'Two' 3 '3 or more'.

count othmajhp=xa60ga xa60gb xa60gc xa60gd xa60ge (5,7,8,9,11,12,13,14,17,19,29,30).

weight by weightr.
recode r20 (sysmis=-99).
missing values r20 (-98, -99).
compute hprob2008=0.
if ((r20 ge 0) and (r20 le 6)) hprob2008=1.
freq hprob2008.

count majhprobs=xa46 xa47 xa52 xa55 (2) othmajhp (1,2).
recode majhprobs (3,4,5=2).

weight by xcweight.
compute marchange=0.
count marchange=xa16a xb11 (2,3,4) xc21 (3,4,5).
recode marchange (2,3=1).

compute lifedisrp2016=0.
compute lifedisrp2016=gremploy + majhprobs + marchange.
recode lifedisrp2016 (1=0)(2 thru hi=1).

weight by xcweight.
freq lifedisrp2016.

*** STUDENT GOALS 

weight off
freq ExpLead40i ExpVote40i ExpInfo40i ExpCand40i VIissuesi VIcorrwrgi VIcommledi.
missing values ExpLead40i ExpVote40i ExpInfo40i ExpCand40i VIissuesi VIcorrwrgi VIcommledi (-99).
descriptives var=ExpLead40i ExpVote40i ExpInfo40i ExpCand40i VIissuesi VIcorrwrgi VIcommledi /save.

compute goals12ifa=(zExpLead40i*.89)+(zExpVote40i*.21)+(zExpInfo40i*.34)+(zExpCand40i*.30)+(zVIissuesi*.59)+(zVIcorrwrgi*.69)+(zVIcommledi*.51).
freq goals12ifa/stat=mean std.

weight by xcweight.
compute goals12ix=rnd(10*(goals12ifa+2.18)/9.34).
freq goals12ix/stat=mean std semean. 

compute sgoals = goals12ix.
recode sgoals (0=0)(1=0)(2=1)(3=1)(4=2)(5=2)(6=2)(7=3)(8=3)(9=4)(10=4).
freq sgoals.



weight xcweight.
*Table 1

FREQUENCIES VARIABLES=valid2016d 
  /ORDER=ANALYSIS.

*Table 2

CROSSTABS 
  /TABLES=xcrecall BY valid2016d 
  /FORMAT=AVALUE TABLES 
  /CELLS=ROW 
  /COUNT ROUND CELL.

missing values overr16d(-99).
CROSSTABS 
  /TABLES=xcrecall BY overr16d 
  /FORMAT=AVALUE TABLES 
  /STATISTICS=GAMMA 
  /CELLS=ROW 
  /COUNT ROUND CELL.

compute overr16e=valid2016d.
recode overr16e (1=0) (2=0) (3=1) (4=0).
missing values overr16e(-99).
value labels overr16e 0'Non-overreporters' 1'over-reporters'.

CROSSTABS 
  /TABLES=xcrecall BY overr16e 
  /FORMAT=AVALUE TABLES 
  /STATISTICS=GAMMA 
  /CELLS=ROW 
  /COUNT ROUND CELL.


compute corr2016e=valid2016d.
missing values corr2016d(-99).
recode corr2016e (2=0) (3=0) (4=1).
missing values corr2016e(-99).
value labels corr2016e 0'non voters' 1'voters'.

CROSSTABS 
  /TABLES=xcrecall BY corr2016e 
  /FORMAT=AVALUE TABLES 
  /STATISTICS=GAMMA 
  /CELLS=ROW 
  /COUNT ROUND CELL.

*table 3

crosstabs peduc by valid2016d/cells=count row/stat=gamma.
crosstabs peduc by corr2016e/cells=count row/stat=gamma.
crosstabs peduc by overr16e/cells=count row/stat=gamma.

missing values PPOBHI3 (-99).
crosstabs PPOBHI3 by valid2016d/cells=count row/stat=gamma.
crosstabs PPOBHI3 by corr2016e/cells=count row/stat=gamma.
crosstabs PPOBHI3 by overr16e/cells=count row/stat=gamma.

missing values sgoals (-99).
crosstabs sgoals by valid2016d/cells=count row/stat=gamma.
crosstabs sgoals by corr2016e/cells=count row/stat=gamma.
crosstabs sgoals by overr16e/cells=count row/stat=gamma.

missing values lifedisrp2016(-99).
crosstabs lifedisrp2016 by valid2016d/cells=count row/stat=gamma.
crosstabs lifedisrp2016 by corr2016e/cells=count row/stat=gamma.
crosstabs lifedisrp2016 by overr16e/cells=count row/stat=gamma.

*table 4

missing values polint16r5(-99).
crosstabs polint16r5 by valid2016d/cells=count row/stat=gamma.
crosstabs polint16r5 by corr2016e/cells=count row/stat=gamma.
crosstabs polint16r5 by overr16e/cells=count row/stat=gamma.

missing values engage16r5(-99).
crosstabs engage16r5 by valid2016d/cells=count row/stat=gamma.
crosstabs engage16r5 by corr2016e/cells=count row/stat=gamma.
crosstabs engage16r5 by overr16e/cells=count row/stat=gamma.

*table 5

crosstabs nparty7_16 by valid2016d/cells=count row/stat=gamma.
crosstabs nparty7_16 by corr2016e/cells=count row/stat=gamma.
crosstabs nparty7_16 by overr16e/cells=count row/stat=gamma.

missing values ipart_16 (-99).
crosstabs ipart_16 by valid2016d/cells=count row/stat=gamma.
crosstabs ipart_16 by corr2016e/cells=count row/stat=gamma.
crosstabs ipart_16 by overr16e/cells=count row/stat=gamma.



